<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@page import="com.ignou.mca.beans.UserVO"%>
<script type="text/javascript">

	function showSubExam(subID)
	{
		window.location.href = 'Exams.jsp?subject='+subID; 
	}

</script>
<div id="Header"><a href="index.html">
	<img src="images/oes_logo.gif"/>Online Examination System</a>
</div>

<!--  Header menus: 
		Default Menu: Home, Login,Registration,User Activation, About Us
		Admin Menu:	Admin Home,About Us
		User Menu: User Home, About Us
-->
<div id="HeaderMenus">
	<% 
		UserVO uvo = (UserVO) request.getSession().getAttribute("UserVO");
		
		if(uvo!=null && uvo.getRole().equalsIgnoreCase("0"))
		{
	%>
		<ul>
			<li><a href="Home.jsp">Home</a></li>
			<li><a href="Subjects.jsp">Subjects</a></li>
<!-- 			<li><a href="javascript: showSubExam(0)">Exams</a></li> -->
			<li><a href="AboutUs.jsp">About us</a></li>
		</ul>
	<%
		}else if(uvo!=null && uvo.getRole().equalsIgnoreCase("1"))
		{
	%>
	<ul>
		<li><a href="Home.jsp">Home</a></li>
		<li><a href="UserSubjects.jsp">Subjects</a></li>
		<li><a href="UserExams.jsp">Exams</a></li>
		<li><a href="AboutUs.jsp">About us</a></li>
	</ul>
	<%
		}
		else
		{
	%>
		<ul>
			<li><a href="index.jsp">Home</a></li>
			<li><a href="Login.jsp">Login</a></li>
			<li><a href="Registration.jsp">Registration</a></li>
			<li><a href="UserActivation.jsp">Activate Account</a></li>
			<li><a href="AboutUs.jsp">About us</a></li>
		</ul>
	<%
		}
		
		if(uvo!=null)
		{
			String fName = uvo.getFirstName();
			String lName = uvo.getLastName();
			if(fName.length()>5)
				fName = fName.substring(0, 5)+"...";
			
			if(lName.length()>5)
				lName = lName.substring(0, 5)+"...";
	%>
			<div id="greetUser" align="right">
			Hi,<a href="Profile.jsp" title="<%=uvo.getLastName()%> <%=uvo.getFirstName()%>"><%=lName%> <%=fName%></a>
			<a href="Logout.jsp">Logout</a>
			</div>
	<%
		}
	%>
</div>